package com.zfc.controller;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

@RestController
public class TestController {

    @GetMapping("/test/{username}")
    public String testJWT(@PathVariable("username") String username, HttpServletRequest request){
        //....登陆认证
        request.getSession().setAttribute("username", username);
        return "登陆成功！";
    }
}
